<template>
  <div class="callUs">
    <!-- 头部导航栏 -->
    <head-component class="header_bottom" title="联系我们"/>
    <!-- 内容部分 -->
    <div class="call_main">
      <div class="call_box">
        <!-- 电话, 邮箱, 微信 -->
        <div class="call_list" v-for="(item, index) in callList" :key="index">
          <img :src="item.img" alt="">
          <div class="f32 col_ff call_list_name">{{item.name}}:</div>
          <div class="f32 col_ff">{{item.text}}</div>
        </div>
        <!-- 二维码 -->
        <div class="call_ma">
          <img :src="callMa" alt="">
        </div>
        <div class="f28 col_ff call_box_bottom">扫一扫,关注公众号</div>
      </div>
      <a :href="`tel:` + callList[0].text" class="global_btn call_btn">立即联系</a>
    </div>
  </div>
</template>
<script>
import headComponent from '@/components/layout/head';
export default {
  name: '',
  components: {
    headComponent
  },
  data() {
    return {
      callList: [
        {
          img: require('@/common/icon/user/tel.png'),
          name: '电话',
          text: '400-122-2333'
        },
        {
          img: require('@/common/icon/user/email.png'),
          name: '邮箱',
          text: 'xing@163.com'
        },
        {
          img: require('@/common/icon/user/weixin.png'),
          name: '微信',
          text: 'dai123'
        }
      ],
      callMa: require('@/common/image/ma.png')
    }
  },
  watch: {},
  mounted() {
    this.getNews();
  },
  methods: {
    getNews(){
      let $this = this;
      var t = this.$toast.loading({message:'正在加载数据',mask:true, duration:9999})
      $this.$axios.post('index.php?m=user&c=config').then(res => {
        t.clear();
        $this.callList[0].text = res.data.data.w_tel;
        $this.callList[1].text = res.data.data.w_email;
        $this.callList[2].text = res.data.data.w_weixin;
        $this.callMa = res.data.data.w_qrcode
      })
    }
  },
}
</script>
<style lang="less">
  .header_bottom{ border-bottom: 1Px solid #f5f5f5 }
  .call_main{
    margin-top: 2.1333rem;
    padding: 0 0.6rem;
    .call_box{
      height: 10.4rem;
      width: 100%;
      padding-top: 1.333rem;
      border-radius: 0.4rem;
      -webkit-border-radius: 0.4rem;
      text-align: center;
      background: url('~@/common/icon/user/callUs_bg.png') no-repeat 0 0;
      background-size: cover;
      .call_list{
        display: flex;
        display:-webkit-flex;
        margin-bottom: 0.2rem;
        text-align: center;
        align-items: center;
        -webkit-align-items: center;
        margin-left: 1.6rem;
        img{ width: 0.4667rem; }
        .call_list_name{
          margin-left: 0.2rem;
          margin-right: 0.3rem;
        }
      }
      .call_ma{
        width: 3.2667rem;
        height: 3.2667rem;
        margin: 0 auto;
        margin-top: 1.3rem;
        background: url('~@/common/icon/user/callUs_ma.png') no-repeat;
        background-size: 100% 100%;
        img{
          width: 2.6667rem;
          height: 2.6667rem;
          margin-top: 0.3rem;
        }
      }
      .call_box_bottom{ opacity: 0.5; margin-top: 0.4rem;}
    }
    .call_btn{
      display: block;
      margin-top: 2rem;
    }
  }
</style>
